package com.ty.xiaoyu.service;

import com.ty.xiaoyu.entity.Great;
import com.ty.xiaoyu.exception.GreatOperationException;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GreatService {

    // 根据帖子id和用户id获取点赞记录
    Great getGreatByTopicIdAndUserId(@Param("topicId") String topicId, @Param("userId") String userId);

    // 根据点赞id删除记录
    void cancelGreat(@Param("great") Great great) throws GreatOperationException;

    // 根据点赞id更新记录
    void editGreat(@Param("great") Great great) throws GreatOperationException;

    // 添加点赞记录
    void addGreat(@Param("great") Great great) throws GreatOperationException;

    // 获取当然用户的点赞列表
    List<Great> getGreatListByUserId(@Param("userId") String userId) throws GreatOperationException;
}
